home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1988 September / 1988-09.d64 / boom & bust (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  146 lines

  1. 10 rem copyright 1988 compute! publications, inc. - all rights reserved
  2. 20 ifa=1then80
  3. 30 print"[147][144]      copyright 1988       [146]"
  4. 40 print"compute! publications, inc.[146]"
  5. 50 print "   all rights reserved     [146]":fori=1to1500:next
  6. 70 a=1:load"b&b.ml",8,1
  7. 80 forsd=0to5:readsd(sd):poke52580+sd*2,sd(sd):next
  8. 90 forn=1to8:readfh(n),fl(n):next:sid=54272
  9. 100 dima$(50)
  10. 110 reada$(t):ifa$(t)<>"end"thent=t+1:goto110
  11. 120 t=t-1:sys16385:poke845,0:poke844,0
  12. 130 forn=0to2*t:r1=int(rnd(0)*t):r2=int(rnd(0)*t)+1:t$=a$(r1):a$(r1)=a$(r2)
  13. 140 a$(r2)=t$:next
  14. 150 k=0:p=1:sc(0)=0:sc(1)=0:sf(0)=0:sf(1)=0:fl=0:rg=0:ff=0
  15. 160 print"[147]":poke214,11:poke211,14:printchr$(142)"[159]boom and bust":gosub880
  16. 170 print"press 1[146] for 1 player"
  17. 180 print"press 2[146] for 2 players ";
  18. 190 getk$:ifk$=""then190
  19. 200 ifk$<>"1"andk$<>"2"then190
  20. 210 printk$;:d$(1)="phrase":d$(2)="thing":d$(3)="occupation"
  21. 220 p$(0)=" player 1 [146]":p$(1)="[158] player 2 [146]":e$="           "
  22. 230 ifk$="1"thenk=1:p=0:p$(1)="  [158] bonus [146]"
  23. 240 fort1=0tot:forsd=0to5:poke52580+sd*2,sd(sd):next
  24. 250 poke845,0:poke53269,peek(53269)or1
  25. 260 q=0
  26. 270 d$=left$(a$(t1),1):a$=right$(a$(t1),len(a$(t1))-1)
  27. 280 d=val(d$):d$=d$(d):sc(0)=0:sc(1)=0:rg=0
  28. 290 ifk=1thensc(1)=100
  29. 300 f=(40-len(a$))/2
  30. 310 poke857,30:poke845,0:gosub1110
  31. 320 sp=0:forn=1tolen(a$):m$=mid$(a$,n,1):ifm$=" "thensp=sp+1:goto340
  32. 330 poke1703+n+f,83:poke55975+n+f,1
  33. 340 next
  34. 350 ifk=0thenp=abs(p-1)
  35. 360 tm=125:poke844,p
  36. 370 gosub1170
  37. 380 fr=fre(0):poke845,1
  38. 390 wr=0:ifpeek(197)=4thenpoke845,0:gosub660:ifwr=2thennextt1:goto1040
  39. 400 ifwr=1thenpoke53269,peek(53269)or1:goto350
  40. 410 tm=tm-1:iftm<10thengosub970
  41. 420 iftm<1andpeek(833)<>2andpeek(857)=qthenpoke845,0:d=30:gosub840:goto350
  42. 430 ifpeek(845)=1then390
  43. 440 tm=100:forn=1to500:nextn:ifpeek(857)=qthend=20:gosub840:goto350
  44. 450 q=peek(857):r=peek(837):s=peek(838)/2:l=94-(r*6)-(6-s)
  45. 460 in=0:ifl>90thenl=l-56:in=64
  46. 470 m=0:forn=1tolen(a$)
  47. 480 ifmid$(a$,n,1)<>chr$(l)then570
  48. 490 rg=rg+1:m=1:poke54283,33:poke1703+n+f,l-64+in:poke55975+n+f,7
  49. 500 a1$=left$(a1$,n-1)+" "+mid$(a1$,n+1,len(a1$)):poke54283,32
  50. 510 sc(p)=sc(p)+10:gosub610
  51. 520 ma=1:fm=0:forn1=1tolen(a$):m$=mid$(a1$,n1,1):ifm$=" "then550
  52. 530 iffm=0thenm1$=m$:fm=1
  53. 540 ifm$<>m1$thenma=0
  54. 550 next
  55. 560 iflen(a$)-rg-sp=1orma=1thengosub660:goto1010
  56. 570 next
  57. 580 ifm=1then380
  58. 590 d=20:gosub840:goto350
  59. 600 rem
  60. 610 forc=0to1:sc$(c)=str$(sc(c)):sc$(c)=sc$(c)+left$(e$,7-len(sc$(c))):next
  61. 620 forc=0to1:sc$(c)=str$(sc(c)):sc$(c)=sc$(c)+left$(e$,7-len(sc$(c))):next
  62. 630 print"";:poke214,21:print:poke211,1:print"$"sc$(0)tab(31)"$"sc$(1);
  63. 640 return
  64. 650 rem
  65. 660 poke53269,peek(53269)and254:poke198,0:poke214,22:print:poke211,0:w=0:g$=""
  66. 670 print"[159]guess? ";:forn=1tolen(a$):print"[164]";:next:print"[145]":print"";
  67. 680 getg1$:ifg1$=""then680
  68. 690 g1=asc(g1$):ifg1=13then770
  69. 700 ifg1=20andg$<>""theng$=left$(g$,len(g$)-1):fl=1
  70. 710 iffl=1and(len(g$)<len(a$))thenprint"[157][164][157]";
  71. 720 iffl=1and(len(g$)>len(a$)-1)thenprintg1$;
  72. 730 iffl=1thenfl=0:goto680
  73. 740 ifg1>90org1<32then680
  74. 750 iflen(g$)<33thenprintg1$;:g$=g$+g1$
  75. 760 goto680
  76. 770 ifg$<>a$then810
  77. 780 wr=2:sf(p)=sf(p)+sc(p)+500+sc(1)*k:sc(1)=0
  78. 790 poke781,23:sys59903:print"right!";:poke53269,peek(53269)or1:gosub610
  79. 800 gosub1110:gosub880:return
  80. 810 ifk=1thensc(1)=0
  81. 820 poke781,23:sys59903:print"wrong!";:d=50:gosub840:poke781,23:sys59903
  82. 830 wr=1:gosub610:return
  83. 840 pokesid+4,17:forw=dto5 step-1:pokesid+1,w:forn=1tod:next:next:pokesid+4,16
  84. 850 ifk=1thensc(1)=sc(1)-10:ifsc(1)<0thensc(1)=0
  85. 860 gosub610:return
  86. 870 rem
  87. 880 pokesid+5,15:pokesid+6,252:pokesid+12,15:pokesid+13,252:wf=64
  88. 890 forl=1to30:n=int(rnd(0)*6)+3
  89. 900 ifn=9thenforw=1to60:next:goto950
  90. 910 pokesid,fl(n):pokesid+1,fh(n):poke53248,fl(n)
  91. 920 pokesid+7,fl(n)+10:pokesid+8,fh(n)
  92. 930 ifwf=64thenpokesid+3,7:pokesid+2,150:pokesid+10,7:pokesid+9,150
  93. 940 pokesid+4,wf+1:pokesid+11,17:forw=1to80:next:pokesid+4,wf:pokesid+11,16
  94. 950 next:poke53248,28:return
  95. 960 rem
  96. 970 pokesid+6,242:pokesid+1,80:pokesid+4,17:pokesid+4,16
  97. 980 forn=1totm+80:nextn:pokesid+1,60:pokesid+4,17
  98. 990 pokesid+4,16:forn=1totm+50:nextn:return
  99. 1000 rem
  100. 1010 ifwr=2thennextt1:goto1040
  101. 1020 ifk=0thenp=abs(p-1):gosub1170:gosub660:ifwr=2thennextt1:goto1040
  102. 1030 print:printa$:forn=1to1500:next:nextt1
  103. 1040 poke53269,1
  104. 1050 ifsf(0)>sf(1)thenp$=p$(0)
  105. 1060 ifsf(0)<sf(1)thenp$=p$(1)
  106. 1070 ifsf(0)=sf(1)thenprintspc(15);:print"[156]tie game!!":goto1100
  107. 1080 print:print"[145][145][156]congratulations to "p$
  108. 1090 print:print"boom and bust champion!!"
  109. 1100 gosub880:goto130
  110. 1110 forc=0to1:sf$(c)=str$(sf(c)):sf$(c)=sf$(c)+left$(e$,7-len(sf$(c))):next
  111. 1120 print"":gosub610:poke214,19:print:poke211,1
  112. 1130 ifk=0thenprint"$"sf$(0)spc(22)"[158]$"sf$(1)
  113. 1140 ifk=1thenprint"$"sf$(0)
  114. 1150 printp$(0)spc(19)p$(1):gosub610:a1$=a$
  115. 1160 return
  116. 1170 poke53280,9-p*2:poke214,11:print:poke211,10:printp$(p)" "d$:return
  117. 1180 rem
  118. 1190 data 153,154,163,164,165,166
  119. 1200 data28,49,31,165,33,135,37,62,42,62,44,193,50,60,25,30
  120. 1210 data"1a stitch in time saves nine"
  121. 1220 data"1violets are blue"
  122. 1230 data"1love conquers all"
  123. 1240 data"1where is the fire"
  124. 1250 data"1of mice and men"
  125. 1260 data"1along came a spider"
  126. 1270 data"3police officer"
  127. 1280 data"1please keep off the grass"
  128. 1290 data"1little red riding hood"
  129. 1300 data"1the right stuff"
  130. 1310 data"1a penny for your thoughts"
  131. 1320 data"3school teacher"
  132. 1330 data"3taxi driver"
  133. 1340 data"2book marker"
  134. 1350 data"2car"
  135. 1360 data"2shopping cart"
  136. 1370 data"2a glass of milk"
  137. 1380 data"3computer programmer"
  138. 1390 data"3cook"
  139. 1400 data"3nurse"
  140. 1410 data"3inventor"
  141. 1420 data"1silence is golden"
  142. 1430 data"1sugar and spice"
  143. 1440 data"1the three little pigs"
  144. 1450 data"end"
  145. 1460 end
  146.